<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Vue 测试实例</title>
  <script src="https://unpkg.com/vue@3.5.13"></script>
</head>

<body>
<ul id="array-rendering" class="demo">
  <li v-for="item in items" :key="item.message">
    {{ item.message }}
  </li>

  <!-- 带索引 -->
  <li v-for="(item, index) in items">
    {{ index }} - {{ item.message }}
  </li>
</ul>

<script>
  Vue.createApp({
    data() {
      return {
        items: [{ message: 'Foo' }, { message: 'Bar' }]
      }
    }
  }).mount('#array-rendering')
</script>
</body>
</html>